from config import db
import datetime


class USER(db.Model):
    __tablename__ = 'roles'
    id = db.Column(db.Integer, primary_key=True)
    nickName = db.Column(db.String(64), nullable=True)
    sno = db.Column(db.Integer, nullable=True)
    spw = db.Column(db.String(64), nullable=True)
    openid = db.Column(db.String(64), nullable=True)
    avatarUrl = db.Column(db.String(64), nullable=True)
    gender = db.Column(db.Integer, nullable=True)
    province = db.Column(db.String(64), nullable=True)
    city = db.Column(db.String(64), nullable=True)
    country = db.Column(db.String(64), nullable=True)
    language = db.Column(db.String(64), nullable=True)
    create_time = db.Column(db.DateTime, default=datetime.datetime.now())
    update_time = db.Column(db.DateTime, default=datetime.datetime.now())
    name = db.Column(db.String(64), nullable=True)
    college = db.Column(db.String(64), nullable=True)
    cla = db.Column(db.String(64), nullable=True)
    prof = db.Column(db.String(64), nullable=True)
    birth = db.Column(db.String(64), nullable=True)
    grade = db.Column(db.String(64), nullable=True)

class Mark(db.Model):
    __tablename__ = 'grade'
    year=db.Column(db.String(64), nullable=True)
    semester=db.Column(db.Integer, nullable=True)
    cname=db.Column(db.String(64), nullable=True)
    credit=db.Column(db.String(64), nullable=True)
    point=db.Column(db.String(64), nullable=True)
    usually=db.Column(db.String(64), nullable=True)
    mid=db.Column(db.String(64), nullable=True)
    final=db.Column(db.String(64), nullable=True)
    experiment=db.Column(db.String(64), nullable=True)
    grade=db.Column(db.String(64), nullable=True)
    id=db.Column(db.Integer, primary_key=True)
    roles_id=db.Column(db.Integer, nullable=True)
    openid=db.Column(db.String(64), nullable=True)

class Class(db.Model):
    __tablename__ = 'cla'
    id = db.Column(db.Integer, primary_key=True)
    roles_id = db.Column(db.Integer, nullable=True)
    openid = db.Column(db.String(64), nullable=True)
    type = db.Column(db.Integer, nullable=True)
    start = db.Column(db.Integer, nullable=True)
    end = db.Column(db.Integer, nullable=True)
    day_week = db.Column(db.Integer, nullable=True)
    cour_start = db.Column(db.Integer, nullable=True)
    cour_length = db.Column(db.Integer, nullable=True)
    cour_name = db.Column(db.String(64), nullable=True)
    teacher_name = db.Column(db.String(64), nullable=True)
    cour_where = db.Column(db.String(64), nullable=True)
    jud = db.Column(db.Integer, nullable=True)
    year = db.Column(db.String(64), nullable=True)
    term = db.Column(db.String(64), nullable=True)